#include <iostream>
using namespace std;
int main()
{
    int n,m,k=1,count=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        m=i;
        k=1;
        while(m)
        {
            k*=m;
            m--;
        }
        count+=k;
    }
    cout<<count;
    return 0;
}
